package edu.utah.seq.data;
import java.io.*;

public class EnrichedRegion implements Serializable{

	//fields
	private String chromosome;
	private int start;		//inclusive
	private int stop;		//exclusive		
	private int numberOfWindows;
	private SmoothingWindow bestWindow;	
	
	//optional fields, may be null
	private String sequence; //genomic sequence of ER
	private Point[] treatmentPoints; //data
	private Point[] controlPoints; //data
	private SmoothingWindow[] subWindows;
	private SmoothingWindow bestSubWindow;

	//change this value when making major changes that should void any saved Objects
	public static final long serialVersionUID = 2;
	
	//constructors
	public EnrichedRegion (SmoothingWindow window, Info info){
		chromosome = info.getChromosome();
		int half = info.getReadLength()/2;
		start = window.getStart()-half;
		stop = window.getStop()+half;
		bestWindow = window;
	}
	public EnrichedRegion(SmoothingWindow window, int halfReadLength){
		start = window.getStart()-halfReadLength;
		stop = window.getStop()+halfReadLength;
	}
	public EnrichedRegion(){};

	//methods
	public SmoothingWindow getBestWindow() {
		return bestWindow;
	}

	public void setBestWindow(SmoothingWindow bestWindow) {
		this.bestWindow = bestWindow;
	}

	public String getChromosome() {
		return chromosome;
	}

	public void setChromosome(String chromosome) {
		this.chromosome = chromosome;
	}

	public int getNumberOfWindows() {
		return numberOfWindows;
	}

	public void setNumberOfWindows(int numberOfWindows) {
		this.numberOfWindows = numberOfWindows;
	}

	public String getSequence() {
		return sequence;
	}

	public void setSequence(String sequence) {
		this.sequence = sequence;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getStop() {
		return stop;
	}

	public void setStop(int stop) {
		this.stop = stop;
	}

	public Point[] getControlPoints() {
		return controlPoints;
	}

	public void setControlPoints(Point[] controlPoints) {
		this.controlPoints = controlPoints;
	}

	public Point[] getTreatmentPoints() {
		return treatmentPoints;
	}

	public void setTreatmentPoints(Point[] treatmentPoints) {
		this.treatmentPoints = treatmentPoints;
	}
	public SmoothingWindow[] getSubWindows() {
		return subWindows;
	}
	public void setSubWindows(SmoothingWindow[] subWindows) {
		this.subWindows = subWindows;
	}
	public SmoothingWindow getBestSubWindow() {
		return bestSubWindow;
	}
	public void setBestSubWindow(SmoothingWindow bestSubWindow) {
		this.bestSubWindow = bestSubWindow;
	}
	
	

}
